From 31ed041b51b0162d30ad13387b0a179449885294 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 1 Nov 2005 17:49:19 +0100 Subject: [PATCH] Fix 'nosmp' and ensure that CPU#0 is reported properly by /proc/cpuinfo. Also fix the sibling and core maps. Signed-off-by: Keir Fraser --- .../arch/xen/kernel/smpboot.c | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c index f1f733df5a..6e15afb008 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c @@ -191,10 +191,17 @@ void __init smp_prepare_cpus(unsigned int max_cpus) int cpu, rc; struct task_struct *idle; - if (max_cpus == 0) - return; + cpu_data[0] = boot_cpu_data; + + cpu_2_logical_apicid[0] = 0; + x86_cpu_to_apicid[0] = 0; + + current_thread_info()->cpu = 0; + cpu_sibling_map[0] = cpumask_of_cpu(0); + cpu_core_map[0] = cpumask_of_cpu(0); - xen_smp_intr_init(0); + if (max_cpus != 0) + xen_smp_intr_init(0); for (cpu = 1; cpu < max_cpus; cpu++) { rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL); @@ -236,9 +243,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } /* Currently, Xen gives no dynamic NUMA/HT info. */ - for (cpu = 0; cpu < NR_CPUS; cpu++) { - cpus_clear(cpu_sibling_map[cpu]); - cpus_clear(cpu_core_map[cpu]); + for (cpu = 1; cpu < NR_CPUS; cpu++) { + cpu_sibling_map[cpu] = cpumask_of_cpu(cpu); + cpu_core_map[cpu] = cpumask_of_cpu(cpu); } #ifdef CONFIG_X86_IO_APIC @@ -256,17 +263,6 @@ void __devinit smp_prepare_boot_cpu(void) cpu_possible_map = cpumask_of_cpu(0); cpu_present_map = cpumask_of_cpu(0); cpu_online_map = cpumask_of_cpu(0); - - cpu_data[0] = boot_cpu_data; - cpu_2_logical_apicid[0] = 0; - x86_cpu_to_apicid[0] = 0; - - current_thread_info()->cpu = 0; - cpus_clear(cpu_sibling_map[0]); - cpu_set(0, cpu_sibling_map[0]); - - cpus_clear(cpu_core_map[0]); - cpu_set(0, cpu_core_map[0]); } static void vcpu_hotplug(unsigned int cpu) -- 2.30.2